package com.xy.modulemain.api

import com.xy.modulemain.bean.Item
import com.xy.modulemain.bean.User
import com.xy.network.bean.ResponseBean
import io.reactivex.Observable
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * @ClassName ApiService
 * @Author xy
 * @Date 2021/8/3 11:36
 * @Description retrofit 网络请求
 */

interface ApiService {
//    http://172.27.35.1:8080/login1?name=%E5%B0%8F%E5%A6%96&password=123456

    //    {"code":3,"msg":"","data":{"password":"123456","userName":"小妖"}}
    @GET("login1")
    fun login1(@Query("name") name: String, @Query("password") password: String): Call<ResponseBean<User>>

    @GET("login1")
    fun login2(@Query("name") name: String, @Query("password") password: String): Observable<ResponseBean<User>>

    @GET("getList")
    fun getList(@Query("index") index: Int, @Query("pageSize") pageSize: Int): Observable<ResponseBean<MutableList<Item>>>

    //获取Title 标题
    @GET("getTitles")
    fun getTitles(@Query("titleSize") titleSize: Int): Observable<ResponseBean<MutableList<String>>>

}